﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraCharts;
using Lib.Utils;

namespace MS.INV.Reports.Qtys
{
    public partial class Qty_Chart_Year : Lib.Bases.Forms.BaseForm
    {
        public Qty_Chart_Year()
        {
            InitializeComponent();

            spY.EditValue = DateTime.Now.Year;
        }

        private void item1_OnRefresh(object sender, EventArgs e)
        {
            chart.Series[0].DataSource = DBLayer.ExecDataTable("Rpt_QtyChartYear", "Year,IdHangHoa",
                Cvert.ToInt32(spY.EditValue, 0), item1.IdHangHoa);
            chart.Series[0].ArgumentDataMember = "Thang";
            chart.Series[0].ValueScaleType = ScaleType.Numerical;
            chart.Series[0].ValueDataMembers.AddRange(new string[] { "SoLuong" });
            chart.Series[0].LegendText = Cvert.ToInt32(spY.EditValue, 0).ToString();
        }

        private void item1_OnPrint(object sender, EventArgs e)
        {

        }

        private void Qty_Chart_Year_Load(object sender, EventArgs e)
        {
            item1.OnLoad();
        }
    }
}
